﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.IdGenerators;

namespace ChatGPT.Repository;

/// <summary>
///     用户问答日志
/// </summary>
public class ChatLog
{
    /// <summary>
    ///     Gets or sets the identifier.
    /// </summary>
    //_id 由StringObjectIdGenerator 生成，存储类型是string
    [BsonId(IdGenerator = typeof(StringObjectIdGenerator))]
    [BsonRepresentation(BsonType.ObjectId)]
    public string Id { get; set; }

    /// <summary>
    /// </summary>
    public long UserId { get; set; }

    /// <summary>
    ///     角色
    /// </summary>
    public string Role { get; set; }

    /// <summary>
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// </summary>
    [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
    public DateTime CreateTime { get; set; }
}